package com.crh.service.impl;

import com.crh.bean.Doc;
import com.crh.mapper.DocMapper;
import com.crh.service.DocService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author Chrui
 * @date 2018/10/13__15:16
 */
@Service
public class DocServiceImpl implements DocService {
    @Resource
    private DocMapper docMapper;



    /**
     * @param doc
     * @param limit
     * @param offets
     * @return
     */
    @Override
    public PageInfo<Doc> queryAllDocList(Doc doc, Integer limit, Integer offets) {
        Map<String, Object> map = new HashMap<>();
        map.put("doc", doc);
        PageHelper.startPage(offets, limit);
        List<Doc> docList = docMapper.queryAllDocList(map);
        PageInfo<Doc> docPageInfo = new PageInfo<>(docList);
        return docPageInfo;
    }


}
